

#import "FAMHomeTableHeaderFoodView.h"
@interface FAMHomeTableHeaderFoodView()
@property (weak, nonatomic) IBOutlet UIView *FAMTranscriptBackView;
@property (weak, nonatomic) IBOutlet UIImageView *FAMFoodImageView;
@property (weak, nonatomic) IBOutlet UILabel *FAMFoodNameLabel;

@end
@implementation FAMHomeTableHeaderFoodView

- (instancetype)init{
    self = [super init];
    if (self) {
        NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"FAMHomeTableHeaderFoodView" owner:self options:nil];
        self = array.firstObject;
        [self FAM_showUi];
    }
    return self;
}
- (void)FAM_showUi{
    UITapGestureRecognizer *transcriptTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(FAM_transcriptTapClick:)];
    [self.FAMTranscriptBackView addGestureRecognizer:transcriptTap];
}
- (void)FAM_transcriptTapClick:(UITapGestureRecognizer *)sender{
    FAMHomeWriteFoodView *writeFoodView = [[FAMHomeWriteFoodView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    writeFoodView.FAMCateType = _FAMCateType;
    writeFoodView.FAMDate = _FAMDate;
    [UIWindow.currentViewController.view addSubview:writeFoodView];
}
- (IBAction)FAM_photoButtonClick:(UIButton *)sender {
    FAMCameraTakeShotViewController *vc = [FAMCameraTakeShotViewController new];
    vc.FAMCateType = _FAMCateType;
    [UIWindow.currentViewController.navigationController pushViewController: vc animated:YES];
}
- (void)setDataDic:(NSDictionary *)dataDic{
    self.FAMFoodImageView.image = [UIImage imageNamed:dataDic[@"icon"]];
    self.FAMFoodNameLabel.text = dataDic[@"title"];
}
- (void)setFAMCateType:(NSString *)FAMCateType{
    _FAMCateType = FAMCateType;
}
- (void)setFAMDate:(NSString *)FAMDate{
    _FAMDate = FAMDate;
}
@end
